package com.vimi8.ebb.api.ebb;

import com.vimi8.ebb.configuration.HttpResponseEntity;
import com.vimi8.ebb.dto.LogisticsBusinessDTO1;
import com.vimi8.ebb.dto.LogisticsDTO;
import com.vimi8.ebb.model.Logistics;
import com.vimi8.ebb.model.Paginator;
import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.*;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 物流信息api
 * Created by xiehuang on 2017/1/19.
 */
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringCodegen", date = "2016-09-12T05:46:07.581Z")
@RestController
@Api(value = "logistics", description = "the logistics API")
@RequestMapping("/front/logistics")
public interface LogisticsFrontApi {
    @ApiOperation(value = "查询物流信息", notes = "查询物流信息.", response = Logistics.class,
            tags = {"物流信息",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回物流信息列表", response = Logistics.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class)})
    @RequestMapping(value = "/",
            method = RequestMethod.GET)
    HttpResponseEntity<Paginator<List<LogisticsBusinessDTO1>>> getLogistics(
            @ApiParam(value = "当前页码", required = true) @RequestParam(value = "start", required = true) int start,
            @ApiParam(value = "每页大小", required = true) @RequestParam(value = "size", required = true) int size,
            @ApiParam(value = "地址编码", required = false) @RequestParam(value = "addressCode", required = false) String addressCode,
            @ApiParam(value = "网点名称", required = false) @RequestParam(value = "branchName", required = false) String branchName,
            @ApiParam(value = "按员工人数排序（asc表示升序，desc表示降序）", required = false) @RequestParam(value = "staffsOrder", required = false) String staffsOrder,
            @ApiParam(value = "按统计日期排序（asc表示升序，desc表示降序）", required = false) @RequestParam(value = "statisticsTimeOrder", required = false) String statisticsTimeOrder
    );

    @ApiOperation(value = "根据ID查询物流信息", notes = "根据ID查询物流信息.", response = Logistics.class,
            tags = {"物流信息",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回物流信息", response = Logistics.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class)})
    @RequestMapping(value = "/{id}",
            method = RequestMethod.GET)
    HttpResponseEntity<LogisticsDTO> getLogisticsById(
            @ApiParam(value = "id", required = true) @PathVariable(value = "id", required = true) String id
    );

    @ApiOperation(value = "物流分析", notes = "物流分析.", response = Map.class,
            tags = {"物流信息",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回物流统计分析数据", response = Map.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class)})
    @RequestMapping(value = "/analysis",
            method = RequestMethod.GET)
    HttpResponseEntity<Object> getLogisticsAnalysis(
            @ApiParam(value = "地址编码", required = true) @RequestParam(value = "addressCode", required = true) String addressCode,
            @ApiParam(value = "统计时间(如：2016-12-01)", required = true) @RequestParam(value = "tradeStatisticsTime", required = true) String tradeStatisticsTime
    );

    @ApiOperation(value = "各区县物流网点以及业务梳理分析", notes = "各区县物流网点以及业务梳理分析.", response = Map.class,
            tags = {"数据报告",})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功,返回物流统计分析数据", response = Map.class),
            @ApiResponse(code = 200, message = "失败,返回消息", response = String.class)})
    @RequestMapping(value = "/analysis/business",
            method = RequestMethod.GET)
    HttpResponseEntity<Object> getLogisticsBusinessAnalysis(
            @ApiParam(value = "地址编码", required = false) @RequestParam(value = "addressCode", required = false) String addressCode,
            @ApiParam(value = "年-月（如：2017-01）", required = false) @RequestParam(value = "yearAndMonth", required = false) String yearAndMonth,
            @ApiParam(value = "年份", required = false) @RequestParam(value = "year", required = false) String year,
            @ApiParam(value = "季度", required = false) @RequestParam(value = "quarter", required = false) String quarter
    );

}
